import moment from "moment";

const columns = [
    {
        dataIndex: 'name',
        key: 'name',
        slots: {title: 'customTitle'},
        scopedSlots: {customRender: 'name'},
    },
    {
        title: 'Age',
        dataIndex: 'age',
        key: 'age',
    },
    //TODO:axios异步问题无法解决,已经解决，利用mounted
    {
        title: '所属科室',
        dataIndex: 'type',
        key: 'type',
        scopedSlots: {customRender: 'type'},
    },
    {
        title: '性别',
        key: 'gender',
        dataIndex: 'gender',
        scopedSlots: {customRender: 'gender'},
    },
    {
        title: '联系方式',
        dataIndex: 'phone',
        key: 'phone'
    },
    //TODO:日期需要格式化,FINISH
    {
        title: '签约日期',
        dataIndex: 'signDate',
        key: 'signDate',
        //日期格式化
        customRender: (text) => {
            return moment(text).format('YYYY-MM-DD')
        }
    },
    {
        title: 'Action',
        key: 'action',
        scopedSlots: {customRender: 'action'},
    },
];


export default columns;